﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PackagePrice.ascx.cs" Inherits="PayrollHR.Administration.Modules.PackagePriceControl" %>
<%@ Register Src="ConfirmationBox.ascx" TagName="ConfirmationBox" TagPrefix="uc1" %>
<%@ Register Src="PackagePriceSearch.ascx" TagName="PackagePriceSearch" TagPrefix="uc2" %>
<script type="text/javascript">
    $(window).bind('load', function () {
        var cbHeader = $(".cbHeader input");
        var cbRowItem = $(".cbRowItem input");
        cbHeader.bind("click", function () {
            cbRowItem.each(function () { this.checked = cbHeader[0].checked; })
        });
        cbRowItem.bind("click", function () { if ($(this).checked == false) cbHeader[0].checked = false; });
    });
</script>
<script src="//code.jquery.com/jquery-1.9.1.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<asp:UpdatePanel ID="upForumSubscriptions" runat="server">
    <ContentTemplate>
        <div class="section-header">
            <div class="title">
                <img src="Common/ico-customers.png" alt="Admin.PackagePrice.ManagerPackagePrice" />
                <%=GetLocaleResourceString("Admin.PackagePrice.ManagerPackagePrice")%>
            </div>
            <div class="options">
                <asp:HyperLink runat="server" Visible="False" ID="hlexport" ForeColor="#6600CC">[hlexport]</asp:HyperLink>
                <asp:Button ID="SearchButton" runat="server" Text="Filter"
                    CssClass="adminButtonBlue" OnClick="SearchButton_Click" ToolTip="Filter" />
                <asp:Button ID="ExportButton" runat="server" Text="Export template"
                    CssClass="adminButtonBlue" OnClick="ExportButton_Click" ToolTip="Filter" />
                <asp:Button runat="server" Text="Delete"
                    CssClass="adminButtonBlue" ID="btnDelete" OnClick="btnDelete_Click" ValidationGroup="ExportXLS"
                    ToolTip="Delete Customer" />
                <uc1:ConfirmationBox ID="cbDelete" runat="server" TargetControlID="btnDelete"
                    YesText="<% $PayrollResources:Admin.Common.Yes %>" NoText="<% $PayrollResources:Admin.Common.No %>"
                    ConfirmText="<% $PayrollResources:Admin.Common.AreYouSure %>" />
                <asp:Button runat="server" Text="Inport"
                    CssClass="adminButtonBlue" ID="btnInport" OnClick="btnInport_Click" ValidationGroup="ExportXLS"
                    ToolTip="Inport Package price" />
                <asp:FileUpload ID="fileUpload" runat="server"></asp:FileUpload>
            </div>
        </div>
        <div>
            <uc2:PackagePriceSearch ID="PackagePriceSearch1" runat="server" />
        </div>
        <p></p>
        <asp:GridView ID="gvPackage" runat="server" AutoGenerateColumns="False" Width="100%" DataKeyNames="PackagePricesID"
            OnPageIndexChanging="gvPackage_PageIndexChanging" OnRowDataBound="gvPackage_RowDataBound" AllowPaging="True"
            PageSize="20">
            <Columns>
                <asp:TemplateField ItemStyle-Width="0.5%" ItemStyle-HorizontalAlign="Center">
                    <HeaderTemplate>
                        <asp:CheckBox ID="cbSelectAll" runat="server" CssClass="cbHeader" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="cbPackagePricesID" runat="server" CssClass="cbRowItem" ToolTip="Click chọn giá" />
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" Width="0.5%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Tên Gói" ItemStyle-Width="10%">
                    <ItemTemplate>
                        <asp:Label runat="server" ID="lblName" Text='<%#Eval("Name") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle Width="10%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Mã gói"
                    HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="6%" ItemStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label runat="server" ID="lblPackCode" Text='<%#Eval("PackCode") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Left" Width="6%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Loại gói"
                    HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="6%" ItemStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label runat="server" ID="lblPackTypeName" Text='<%#Eval("PackTypeName") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Left" Width="6%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Thời hạn"
                    HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="6%" ItemStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label runat="server" ID="lblPackTime" Text='<%#Eval("PackTime") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Left" Width="6%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Gia" ItemStyle-Width="3%">
                    <ItemTemplate>
                        <asp:Label ID="lblPrice" runat="server" Text='<%# Eval("Price")%>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle Width="3%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Ngày hiệu lực" ItemStyle-Width="3%">
                    <ItemTemplate>
                        <asp:Label ID="lblDateApply" runat="server" Text='<%# Eval("DateApply")%>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle Width="3%" />
                </asp:TemplateField>
            </Columns>
            <PagerSettings PageButtonCount="50" Position="TopAndBottom" />
        </asp:GridView>
    </ContentTemplate>
    <Triggers>
        <asp:PostBackTrigger ControlID="btnInport" />
    </Triggers>
</asp:UpdatePanel>
<asp:UpdateProgress ID="up1" runat="server" AssociatedUpdatePanelID="upForumSubscriptions">
    <ProgressTemplate>
        <div class="progress">
            <asp:Image ID="imgUpdateProgress" runat="server" ImageUrl="~/images/UpdateProgress.gif"
                AlternateText="update" />
            <%=GetLocaleResourceString("Admin.Common.Wait...")%>
        </div>
    </ProgressTemplate>
</asp:UpdateProgress>
